package ${package}.service;
import com.bolt.support.base.service.BaseService;
import ${package}.entity.${table.className}Entity;
import ${package}.repository.${table.className}Repository;
import ${package}.dto.${table.className}DTO;
import com.bolt.support.spring.jpa.repository.BasicJpaRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
* Auto Generate Javadoc
* @author
* 日期:${.now?string("yyyy-MM-dd HH:mm:ss")}
* ${table.remarks?default("")}
**/
@Service
@Transactional(readOnly = true,rollbackFor = Exception.class)
@RequiredArgsConstructor
public class  ${table.className}Service extends BaseService<${table.className}Entity, ${table.pkColumn.javaType}>{
    
    private final ${table.className}Repository ${table.className?uncap_first}Repository;

    @Override
    protected BasicJpaRepository<${table.className}Entity, ${table.pkColumn.javaType}> getRepository() {
        return ${table.className?uncap_first}Repository;
    }

    @Transactional(rollbackFor = Exception.class)
    public void saveOrUpdate( ${table.className}DTO dto) {
       ${table.className}Entity entity = ${table.className}Converter.toEntity(dto);
        save(entity);
    }
}
